<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en_US" lang="en_US">
<head>
<title> MobileAgents &lt; Mundo &lt; Foswiki</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="icon" href="/foswiki/pub/System/ProjectLogos/favicon.ico" type="image/x-icon" />
<link rel="shortcut icon" href="/foswiki/pub/System/ProjectLogos/favicon.ico" type="image/x-icon" />
<link rel="alternate" href="http://127.0.0.1/foswiki/bin/edit/Mundo/MobileAgents?t=1295995546" type="application/x-wiki" title="edit MobileAgents" />
<meta name="TEXT_NUM_TOPICS" content="Number of topics:" />
<meta name="TEXT_MODIFY_SEARCH" content="Modify search" />
<meta name="robots" content="noindex" /><link rel="alternate" type="application/rss+xml" title="RSS Feed" href="/foswiki/bin/view/Mundo/WebRss" />
<style type="text/css" media="all">
@import url('style/base.css');
</style>
<style type="text/css" media="all">
@import url('style/layout.css');
@import url('style/style.css');
@import url('style/colors.css');
</style>
<style type="text/css" media="all">
@import url('style/column_left.css');
@import url('style/variant_foswiki_noframe.css');
</style><style type="text/css" media="all">
	/* Styles that are set using variables */
	.patternBookView .foswikiTopRow,
	.patternWebIndicator a img,
	.patternWebIndicator a:hover img {
		background-color:#efefef;
	}
	#patternTopBarContents { background-image:url(/foswiki/pub/System/PatternSkin/header5.gif); background-repeat:repeat-x;}
#patternTopBarContents { background-color:#ffffff;}
.patternBookView {
	border-color:#efefef;
}
.patternPreviewPage #patternMain {
	/* uncomment to set the preview image */
	/*background-image:url("/foswiki/pub/System/PreviewBackground/preview2bg.gif");*/
}
</style>
<style type="text/css" media="all">
@import url('style/print.css');
</style>
<!--[if IE]><style type="text/css" media="screen">
pre {
	height:1%;
	overflow-x:auto;
}
.foswikiAttachments,
.foswikiForm,
.foswikiHelp,
.foswikiPreviewArea,
.patternPreviewPage .foswikiForm,
.patternSigLine,
.patternToolBar,
.patternTop,
.patternTopicAction,
#patternSideBarContents .patternLeftBarPersonal,
#patternSideBarContents h2,
#patternSideBarContents li,
#patternTopBarButtons ul {
	height:1%;
}
#patternSideBarContents .patternLeftBarPersonal {
	width:100%;
}
.foswikiFormStep {
	height:100%;
}
#foswikiLogin,
.patternShadow {
	border:10px solid #fff;
	margin-top:10px;
	margin-bottom:10px;
	border:2px solid #ccc;
}
</style><![endif]-->
<!--[if gt IE 8 ]><style type="text/css" media="screen">
#foswikiLogin,
.patternShadow {
	border:10px solid #fff;
	margin-top:10px;
	margin-bottom:10px;
	box-shadow: 0 0 10px #ccc;
}
</style><![endif]-->
<meta name="foswiki.TWISTYANIMATIONSPEED" content="fast" /><!--TWISTYPLUGIN::META-->
<style type="text/css" media="all">
.foswikiTable {border-width:1px}
.foswikiTable .tableSortIcon img {padding-left:.3em; vertical-align:text-bottom}
.foswikiTable td {border-style:solid none; vertical-align:top}
.foswikiTable th {border-style:none solid; vertical-align:top; background-color:#d6d3cf; color:#000000}
.foswikiTable th a:link {color:#000000}
.foswikiTable th a:visited {color:#000000}
.foswikiTable th a:hover {color:#000000; background-color:#d6d3cf}
.foswikiTable th.foswikiSortedCol {background-color:#c4c1ba}
.foswikiTable tr.foswikiTableRowdataBg0 td {background-color:#ffffff}
.foswikiTable tr.foswikiTableRowdataBg0 td.foswikiSortedCol {background-color:#f7f7f6}
.foswikiTable tr.foswikiTableRowdataBg1 td {background-color:#f7f7f6}
.foswikiTable tr.foswikiTableRowdataBg1 td.foswikiSortedCol {background-color:#f0f0ee}
</style><!--TABLEPLUGIN_default-->
<meta name="foswiki.PUBURL" content="http://127.0.0.1/foswiki/pub" /> <!-- PUBURL -->
<meta name="foswiki.PUBURLPATH" content="/foswiki/pub" /> <!-- PUBURLPATH -->
<meta name="foswiki.SCRIPTSUFFIX" content="" /> <!-- SCRIPTSUFFIX -->
<meta name="foswiki.SCRIPTURL" content="http://127.0.0.1/foswiki/bin" /> <!-- SCRIPTURL -->
<meta name="foswiki.SCRIPTURLPATH" content="/foswiki/bin" /> <!-- SCRIPTURLPATH -->
<meta name="foswiki.SERVERTIME" content="25%20Jan%202011%20-%2023:45" /> <!-- SERVERTIME -->
<meta name="foswiki.SKIN" content="pattern" /> <!-- SKIN -->
<meta name="foswiki.SYSTEMWEB" content="System" /> <!-- SYSTEMWEB -->
<meta name="foswiki.TOPIC" content="MobileAgents" /> <!-- TOPIC -->
<meta name="foswiki.USERNAME" content="guest" /> <!-- USERNAME -->
<meta name="foswiki.USERSWEB" content="Main" /> <!-- USERSWEB -->
<meta name="foswiki.WEB" content="Mundo" /> <!-- WEB -->
<meta name="foswiki.WIKINAME" content="WikiGuest" /> <!-- WIKINAME -->
<meta name="foswiki.WIKIUSERNAME" content="Main.WikiGuest" /> <!-- WIKIUSERNAME -->
<meta name="foswiki.NAMEFILTER" content="%5b%5cs%5c*%3f~%5e%5c%24%40%25%60%22'%26%3b%7c%3c%3e%5c%5b%5c%5d%23%5cx00-%5cx1f%5d" /> <!-- NAMEFILTER --><!--JQUERYPLUGIN::FOSWIKI::META-->
</head>
<body class="patternViewPage patternPrintPage">
<a name="PageTop"></a><div class="foswikiPage"><div id="patternScreen">
<div id="patternPageShadow">
<div id="patternPage">
<div id="patternOuter">
<div id="patternFloatWrap">
<div id="patternMain">
<div id="patternMainContents">
<div class="patternContent"><div class="foswikiTopic"> <h1><a name="Mobile_Agents"></a>  Mobile Agents </h1>
<p /> <ol>
<li> Mobile Code and Agent Basics
</li> <li> <a href="MobileAgents1.html">Creating Autonomous Agents</a>
</li> <li> <a href="MobileAgents2.html">Communicating With Local Services</a>
</li></ol> 
<p />
<h2><a name="Mobile_Code_and_Agent_Basics"></a>  Mobile Code and Agent Basics </h2>
<p />
The source code for this example is located in the directory <code>samples/agent/mobilecode</code>. It is structured into three packages:
<p /> <ul>
<li> <strong>api</strong>: Defines the interfaces used between agent and main application.
</li> <li> <strong>agent</strong>: Contains the service that will travel around.
</li> <li> <strong>app</strong>: Contains the main program that will send the agent around.
</li></ul> 
<p />
<h3><a name="api"></a>  api </h3>
<p />
<strong>samples/agent/mobilecode/src/api/IMyAgent.java</strong>
<!-- SyntaxHighlightingPlugin --><pre class='syntaxHighlightingPlugin'><B><FONT COLOR="#A020F0">package</FONT></B> api;
<B><FONT COLOR="#A020F0">import</FONT></B> org.mundo.annotation.mcRemote;

@mcRemote
<B><FONT COLOR="#A020F0">public</FONT></B> <B><FONT COLOR="#A020F0">interface</FONT></B> IMyAgent {
  <B><FONT COLOR="#A020F0">void</FONT></B> sayHello();
}</pre><!-- end SyntaxHighlightingPlugin -->
<p />
This defines the interface of the agent. It is marked as a remote interface, because we want to be able to call the method <code>sayHello</code> from the master, regardless of the agent's current location.
<p />
<h3><a name="agent"></a>  agent </h3>
<p />
<strong>samples/agent/mobilecode/src/agent/MyAgent.java</strong>
<!-- SyntaxHighlightingPlugin --><pre class='syntaxHighlightingPlugin'><B><FONT COLOR="#A020F0">package</FONT></B> agent;
<B><FONT COLOR="#A020F0">import</FONT></B> org.mundo.annotation.mcSerialize;
<B><FONT COLOR="#A020F0">import</FONT></B> org.mundo.service.Node;
<B><FONT COLOR="#A020F0">import</FONT></B> org.mundo.agent.Agent;
<B><FONT COLOR="#A020F0">import</FONT></B> api.IMyAgent;

@mcSerialize
<B><FONT COLOR="#A020F0">public</FONT></B> <B><FONT COLOR="#A020F0">class</FONT></B> MyAgent <B><FONT COLOR="#A020F0">extends</FONT></B> Agent <B><FONT COLOR="#A020F0">implements</FONT></B> IMyAgent {
  <B><FONT COLOR="#A020F0">public</FONT></B> <B><FONT COLOR="#A020F0">void</FONT></B> sayHello() {
    System.out.println(<B><FONT COLOR="#BC8F8F">&quot;*** Hello from &quot;</FONT></B> + Node.thisNode().getName());
  }
}</pre><!-- end SyntaxHighlightingPlugin -->
<p />
This class defines the implementation for the agent. It will print the name of the current MundoCore node to the console.
<p />
The agent must be packaged into a plug-in component. For this, a plugin description file is required:
<p />
<strong>samples/agent/mobilecode/META-INF/plugin.xml</strong>
<!-- SyntaxHighlightingPlugin --><pre class='syntaxHighlightingPlugin'><B><FONT COLOR="#A020F0">&lt;plug-in xmlns=</FONT></B><B><FONT COLOR="#BC8F8F">&quot;http://mundo.org/2004/plugin/&quot;</FONT></B><B><FONT COLOR="#A020F0">&gt;</FONT></B>
  <B><FONT COLOR="#A020F0">&lt;service xmlns=</FONT></B><B><FONT COLOR="#BC8F8F">&quot;http://mundo.org/2004/plugin/service&quot;</FONT></B><B><FONT COLOR="#A020F0">
           xmlns:xsi=</FONT></B><B><FONT COLOR="#BC8F8F">&quot;http://www.w3.org/1999/XMLSchema-instance&quot;</FONT></B><B><FONT COLOR="#A020F0">&gt;</FONT></B>
    <B><FONT COLOR="#A020F0">&lt;classname&gt;</FONT></B>agent.MyAgent<B><FONT COLOR="#A020F0">&lt;/classname&gt;</FONT></B>
  <B><FONT COLOR="#A020F0">&lt;/service&gt;</FONT></B>
<B><FONT COLOR="#A020F0">&lt;/plug-in&gt;</FONT></B></pre><!-- end SyntaxHighlightingPlugin -->
<p />
To preprocess, compile, and package the agent into <code>agent0.jar</code>, the following ant build rules are used:
<p />
<strong>samples/agent/mobilecode/build.xml</strong>
<!-- SyntaxHighlightingPlugin --><pre class='syntaxHighlightingPlugin'>...
<B><FONT COLOR="#A020F0">&lt;target name=</FONT></B><B><FONT COLOR="#BC8F8F">&quot;preprocess&quot;</FONT></B><B><FONT COLOR="#A020F0"> depends=</FONT></B><B><FONT COLOR="#BC8F8F">&quot;init&quot;</FONT></B><B><FONT COLOR="#A020F0">&gt;</FONT></B>
  <B><FONT COLOR="#A020F0">&lt;apply executable=</FONT></B><B><FONT COLOR="#BC8F8F">&quot;${mcc}&quot;</FONT></B><B><FONT COLOR="#A020F0"> parallel=</FONT></B><B><FONT COLOR="#BC8F8F">&quot;true&quot;</FONT></B><B><FONT COLOR="#A020F0">&gt;</FONT></B>
    <B><FONT COLOR="#A020F0">&lt;arg value=</FONT></B><B><FONT COLOR="#BC8F8F">&quot;-O${prep}&quot;</FONT></B><B><FONT COLOR="#A020F0"> /&gt;</FONT></B>
    <B><FONT COLOR="#A020F0">&lt;arg value=</FONT></B><B><FONT COLOR="#BC8F8F">&quot;-x&quot;</FONT></B><B><FONT COLOR="#A020F0"> /&gt;</FONT></B>
    <B><FONT COLOR="#A020F0">&lt;fileset dir=</FONT></B><B><FONT COLOR="#BC8F8F">&quot;${src}&quot;</FONT></B><B><FONT COLOR="#A020F0">&gt;</FONT></B>
      <B><FONT COLOR="#A020F0">&lt;include name=</FONT></B><B><FONT COLOR="#BC8F8F">&quot;**/*.java&quot;</FONT></B><B><FONT COLOR="#A020F0"> /&gt;</FONT></B>
    <B><FONT COLOR="#A020F0">&lt;/fileset&gt;</FONT></B>
  <B><FONT COLOR="#A020F0">&lt;/apply&gt;</FONT></B>
  <B><FONT COLOR="#A020F0">&lt;copy file=</FONT></B><B><FONT COLOR="#BC8F8F">&quot;prep/metaclasses.xml&quot;</FONT></B><B><FONT COLOR="#A020F0"> todir=</FONT></B><B><FONT COLOR="#BC8F8F">&quot;${build}&quot;</FONT></B><B><FONT COLOR="#A020F0">/&gt;</FONT></B>
<B><FONT COLOR="#A020F0">&lt;/target&gt;</FONT></B>

<B><FONT COLOR="#A020F0">&lt;target name=</FONT></B><B><FONT COLOR="#BC8F8F">&quot;compile&quot;</FONT></B><B><FONT COLOR="#A020F0"> depends=</FONT></B><B><FONT COLOR="#BC8F8F">&quot;preprocess&quot;</FONT></B><B><FONT COLOR="#A020F0">
        description=</FONT></B><B><FONT COLOR="#BC8F8F">&quot;Compile the Java sources&quot;</FONT></B><B><FONT COLOR="#A020F0">&gt;</FONT></B>
  <B><FONT COLOR="#A020F0">&lt;javac destdir=</FONT></B><B><FONT COLOR="#BC8F8F">&quot;${build}&quot;</FONT></B><B><FONT COLOR="#A020F0">
         debug=</FONT></B><B><FONT COLOR="#BC8F8F">&quot;on&quot;</FONT></B><B><FONT COLOR="#A020F0"> debuglevel=</FONT></B><B><FONT COLOR="#BC8F8F">&quot;lines,vars,source&quot;</FONT></B><B><FONT COLOR="#A020F0"> deprecation=</FONT></B><B><FONT COLOR="#BC8F8F">&quot;on&quot;</FONT></B><B><FONT COLOR="#A020F0">
         encoding=</FONT></B><B><FONT COLOR="#BC8F8F">&quot;utf-8&quot;</FONT></B><B><FONT COLOR="#A020F0"> includeantruntime=</FONT></B><B><FONT COLOR="#BC8F8F">&quot;false&quot;</FONT></B><B><FONT COLOR="#A020F0">&gt;</FONT></B>
    <B><FONT COLOR="#A020F0">&lt;classpath refid=</FONT></B><B><FONT COLOR="#BC8F8F">&quot;project.classpath&quot;</FONT></B><B><FONT COLOR="#A020F0"> /&gt;</FONT></B>
    <B><FONT COLOR="#A020F0">&lt;src path=</FONT></B><B><FONT COLOR="#BC8F8F">&quot;${src}&quot;</FONT></B><B><FONT COLOR="#A020F0"> /&gt;</FONT></B>
    <B><FONT COLOR="#A020F0">&lt;src path=</FONT></B><B><FONT COLOR="#BC8F8F">&quot;${prep}&quot;</FONT></B><B><FONT COLOR="#A020F0"> /&gt;</FONT></B>
    <B><FONT COLOR="#A020F0">&lt;include name=</FONT></B><B><FONT COLOR="#BC8F8F">&quot;**/*.java&quot;</FONT></B><B><FONT COLOR="#A020F0"> /&gt;</FONT></B>
  <B><FONT COLOR="#A020F0">&lt;/javac&gt;</FONT></B>
<B><FONT COLOR="#A020F0">&lt;/target&gt;</FONT></B>

<B><FONT COLOR="#A020F0">&lt;target name=</FONT></B><B><FONT COLOR="#BC8F8F">&quot;jar&quot;</FONT></B><B><FONT COLOR="#A020F0"> depends=</FONT></B><B><FONT COLOR="#BC8F8F">&quot;compile&quot;</FONT></B><B><FONT COLOR="#A020F0">&gt;</FONT></B>
  <B><FONT COLOR="#A020F0">&lt;mkdir dir=</FONT></B><B><FONT COLOR="#BC8F8F">&quot;var/master/com&quot;</FONT></B><B><FONT COLOR="#A020F0"> /&gt;</FONT></B>
  <B><FONT COLOR="#A020F0">&lt;jar jarfile=</FONT></B><B><FONT COLOR="#BC8F8F">&quot;var/master/com/agent1.jar&quot;</FONT></B><B><FONT COLOR="#A020F0">&gt;</FONT></B>
    <B><FONT COLOR="#A020F0">&lt;fileset dir=</FONT></B><B><FONT COLOR="#BC8F8F">&quot;.&quot;</FONT></B><B><FONT COLOR="#A020F0">&gt;</FONT></B>
      <B><FONT COLOR="#A020F0">&lt;include name=</FONT></B><B><FONT COLOR="#BC8F8F">&quot;META-INF/*&quot;</FONT></B><B><FONT COLOR="#A020F0">/&gt;</FONT></B>
    <B><FONT COLOR="#A020F0">&lt;/fileset&gt;</FONT></B>
    <B><FONT COLOR="#A020F0">&lt;fileset dir=</FONT></B><B><FONT COLOR="#BC8F8F">&quot;${build}&quot;</FONT></B><B><FONT COLOR="#A020F0">&gt;</FONT></B>
      <B><FONT COLOR="#A020F0">&lt;include name=</FONT></B><B><FONT COLOR="#BC8F8F">&quot;api/**&quot;</FONT></B><B><FONT COLOR="#A020F0">/&gt;</FONT></B>
      <B><FONT COLOR="#A020F0">&lt;include name=</FONT></B><B><FONT COLOR="#BC8F8F">&quot;agent/**&quot;</FONT></B><B><FONT COLOR="#A020F0">/&gt;</FONT></B>
      <B><FONT COLOR="#A020F0">&lt;include name=</FONT></B><B><FONT COLOR="#BC8F8F">&quot;metaclasses.xml&quot;</FONT></B><B><FONT COLOR="#A020F0">/&gt;</FONT></B>
    <B><FONT COLOR="#A020F0">&lt;/fileset&gt;</FONT></B>
  <B><FONT COLOR="#A020F0">&lt;/jar&gt;</FONT></B>
<B><FONT COLOR="#A020F0">&lt;/target&gt;</FONT></B>
...</pre><!-- end SyntaxHighlightingPlugin -->
<p />
<h3><a name="app"></a>  app </h3>
<p />
Now let's have a look at the main application, which will create the agent and send it around. <code>MyApp</code> will be run on the MundoCore node <code>master</code>. To configure this node name and to enable loading of plug-in components, the master node uses the following <code>node.conf.xml</code> configuration file. It defines that plug-ins will be loaded from the subdirectory <code>com</code>. This is the directory, where we will initially place the agent, which we have packaged into <code>agent0.jar</code> before.
<p />
<strong>samples/agent/mobilecode/var/master/node.conf.xml</strong>
<!-- SyntaxHighlightingPlugin --><pre class='syntaxHighlightingPlugin'>&lt;NodeConfig xsi:type=<B><FONT COLOR="#BC8F8F">&quot;map&quot;</FONT></B> xmlns:xsi=<B><FONT COLOR="#BC8F8F">&quot;http://www.w3.org/1999/XMLSchema-instance&quot;</FONT></B>&gt;
  &lt;config-type&gt;overlay&lt;/config-type&gt;
  &lt;name&gt;master&lt;/name&gt;

  &lt;ServiceManager xsi:type=<B><FONT COLOR="#BC8F8F">&quot;map&quot;</FONT></B> activeClass=<B><FONT COLOR="#BC8F8F">&quot;ServiceManager$Options&quot;</FONT></B>&gt;
    &lt;plugin-directory&gt;com&lt;/plugin-directory&gt;
  &lt;/ServiceManager&gt;
  ...
&lt;/NodeConfig&gt;</pre><!-- end SyntaxHighlightingPlugin -->
<p />
The following implementation file creates an instance of the agent, sends it to <code>server1</code> and then back to the <code>master</code>. It performs the following steps:
<p /> <ol>
<li> It creates a service for the client. This is necessary, because for all communications in MundoCore, there must always be a service context. This applies for the callee as well as the caller.
</li> <li> An instance of the agent is created using <code>Agent.newInstance</code>. It would not be possible to directly create the object (i.e., using <code>new <span class="foswikiNewLink">MyAgent<a href="/foswiki/bin/edit/Mundo/MyAgent?topicparent=Mundo.MobileAgents" rel="nofollow" title="Create this topic">?</a></span>()</code>, because the agent is loaded from a plug-in. <code>Agent.newInstance</code> returns a remote reference of type <code>DoIMobility</code>, which can be used to move the agent.
</li> <li> Next, we cast the reference to <code>DoIMyAgent</code>, which allows us to call the methods of our agent interface <code>IMyAgent</code>.
</li></ol> 
Because calls on the agent interface and calls to the <code>IMobility</code> interface are done through distributed objects, these calls can be performed regardless of the agent's current location.
<p />
<strong>samples/agent/mobilecode/src/app/MyApp.java</strong>
<!-- SyntaxHighlightingPlugin --><pre class='syntaxHighlightingPlugin'><B><FONT COLOR="#A020F0">package</FONT></B> app;
<B><FONT COLOR="#A020F0">import</FONT></B> org.mundo.rt.Mundo;
<B><FONT COLOR="#A020F0">import</FONT></B> org.mundo.rt.Service;
<B><FONT COLOR="#A020F0">import</FONT></B> org.mundo.agent.Agent;
<B><FONT COLOR="#A020F0">import</FONT></B> org.mundo.agent.DoIMobility;
<B><FONT COLOR="#A020F0">import</FONT></B> api.DoIMyAgent;

<B><FONT COLOR="#A020F0">public</FONT></B> <B><FONT COLOR="#A020F0">class</FONT></B> MyApp {
  <B><FONT COLOR="#A020F0">public</FONT></B> <B><FONT COLOR="#A020F0">static</FONT></B> <B><FONT COLOR="#A020F0">void</FONT></B> main(String args[]) {
    Mundo.init();
    <B><FONT COLOR="#A020F0">try</FONT></B> {
      Service client = <B><FONT COLOR="#A020F0">new</FONT></B> Service();
      Mundo.registerService(client);
   
      DoIMobility mobility = Agent.newInstance(client.getSession(), <B><FONT COLOR="#BC8F8F">&quot;agent.MyAgent&quot;</FONT></B>);
      DoIMyAgent agent = <B><FONT COLOR="#A020F0">new</FONT></B> DoIMyAgent(mobility);
      agent.sayHello();
      
      mobility.moveTo(<B><FONT COLOR="#BC8F8F">&quot;server1&quot;</FONT></B>);
      agent.sayHello();
   
      mobility.moveTo(<B><FONT COLOR="#BC8F8F">&quot;master&quot;</FONT></B>);
      agent.sayHello();
    }
    <B><FONT COLOR="#A020F0">catch</FONT></B>(Exception x) {
      x.printStackTrace();
    }
    Mundo.shutdown();
  }
}</pre><!-- end SyntaxHighlightingPlugin -->
<p />
<h3><a name="Running_the_example"></a>  Running the example </h3>
<p />
The example uses two MundoCore nodes, named <code>master</code> and <code>server1</code>. Their working directories reside in <code>var/master</code> and <code>var/server1</code>, respectively. The buildfile will generate the runscripts <code>run-server1</code> and <code>run-master</code> to start these nodes. To run the example, start <code>run-server1</code> and then <code>run-master</code>.
<p /> <ul>
<li> <strong>server1</strong> is an "empty" <a href="/foswiki/bin/view/Mundo/MundoCore">MundoCore</a> node. It simply runs <code>org.mundo.util.DefaultApplication</code> from the MundoCore library. The <code>node.conf.xml</code> configuration file in the <code>var/server1</code> subdirectory defines the node name and the plug-in directory. This is necessary to receive mobile code from peers.
</li> <li> <strong>master</strong> runs the application <strong>MyApp</strong> described above.
</li></ul> 
<p />
Next: <a href="MobileAgents1.html">Creating Autonomous Agents</a>
<p />
</div></div><!-- /patternContent-->
</div></div></div></div></div></div></div></div>
</body></html>
